<?php

/**
 * File Name：RegionModel.php
 * File Encoding：UTF-8
 * File New Time：2014-5-15 15:29:05
 * Author：水平凡
 * Mailbox：admin@abc3210.com
 */
class RegionModel extends BaseModel {

    public function tableName() {
        return '{{region}}';
    }

    public function rules() {
        return array(
        );
    }

    public static function model($className = __CLASS__) {
        return parent::model($className);
    }

    /**
     * 根据$region_id取得名称
     * @param type $region_id
     * @return string
     */
    public function convertRid($region_id){
        $data = $this->findByPk($region_id);
        if(empty($data)){
            return '';
        }
        return $data->region_name;
    }
}
